home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 February / Chip_2003-02_cd1.bin / zkuste / xptools / install / Xsetup / setup.exe / {app} / plugins / XQ IE BHO 1.xpl < prev    next >
Text File  |  2002-10-27  |  5KB  |  182 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH"="Internet\Internet Explorer\System"
  5. "NAME"="Browse Helper Objects"
  6. "VERSION"="1.00"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Show Info"
  9. "TEXT 2"="Enable/Disable"
  10. "DESCRIPTION 1"="Browser Helper Objects (BHO) are DLLs, that are loaded in Internet Explorer as soon as IE starts."
  11. "DESCRIPTION 2"="Some BHOs, for example the Adobe Acrobat BHO, extend the use of IE and allow users to do things that would not be possible without BHOs."
  12. "DESCRIPTION 3"="However, some Spyware programs also use BHOs and there is no way in the normal IE configuration where they can be deactivated."
  13. "DESCRIPTION 4"="Simply click on "Show Info" to see which DLL is loaded when this BHOs is activated. To deactive it, click "Enable/Disable"." 
  14. "AUTHOR"="Xteq Systems"
  15. "CONTACTURL"="http://www.xteq.com"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"="See also: BHOCaptor - Copyright (c) Adam Stiles - See http://www.xcaptor.org/ for updates"
  18. "COMMENT 2"="Also: http://support.microsoft.com/support/kb/articles/Q179/2/30.ASP"
  19.  
  20.  
  21.  
  22. sPath="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\"
  23. sPath_CLSID="HKCR\CLSID\"
  24.  
  25. dim iItems        'contains the total amount of the registry keys
  26. Dim aryItems()    'contains the name of the Registry paths (direct files starting with ".")
  27. Dim aryItemsLoc() 'contains the registry location  (\ShellNew or \ShellNew-)
  28. Dim aryDesc()     'contains the description of the items
  29.  
  30.  
  31.  
  32. Sub Plugin_Initialize 
  33.  iItems=0
  34.  
  35.  if RegPathExists(sPath) then
  36.     Call ReadRegistry
  37.  else
  38.     Call Disable
  39.  end if
  40. End Sub
  41.  
  42.  
  43. Sub ReadRegistry
  44.  for l=1 to iItems
  45.      Call SetUIElement(l,"")
  46.  next 
  47.  
  48.  iItems=RegEnumPaths(sPath) 
  49.  ReDim aryItems(iItems)
  50.  
  51.  For l=1 to iItems 
  52.      'get the GUID
  53.      sGUID=RegEnumElement(l)
  54.      aryItems(l)=sGUID 
  55.      bIsDeactivated=false
  56.  
  57.      if Left(sGUID,1)="-" then
  58.         sGUID=right(sGUID,len(sGUID)-1)
  59.         bIsDeactivated=true
  60.      end if
  61.  
  62.  
  63.      'get the desc
  64.      sName=RegReadValue(sPath_CLSID & sGUID & "\@")
  65.      if len(sName)=0 then 
  66.         sName=sGUID
  67.      end if  
  68.     
  69.      if bIsDeactivated=false then
  70.         Call SetUIElement(l,sName) 
  71.      else 
  72.         Call SetUIElement(l,sName & " [Deactivated]")
  73.      end if 
  74.  next
  75.  
  76.  
  77. End Sub
  78.  
  79. Sub GetInfo(Item)
  80.   'get the filename
  81.   sFile=RegReadValue(sPath_CLSID & Item & "\InprocServer32\@")
  82.   
  83.   Call MsgInformation(sFile) 
  84. End Sub
  85.  
  86.  
  87.  
  88. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  89.  if ElementSubIndex>0 then
  90.     sGUID=aryItems(ElementSubIndex)
  91.     bDeac=false
  92.  
  93.     if left(sGUID,1)="-" then
  94.        sGUID=right(sGUID,len(sGUID)-1)
  95.        bDeac=true
  96.     else
  97.        sGUID=sGUID
  98.        bDeac=false
  99.     end if
  100.  
  101.     if ElementIndex=1 then '//Information
  102.        Call GetInfo(sGUID)
  103.     else
  104.        if bDeac=false then
  105.           Call MoveFolder(sPath & sGUID, sPath & "-" & sGUID)
  106.        else
  107.           Call MoveFolder(sPath & "-" & sGUID, sPath & sGUID)
  108.        end if      
  109.  
  110.        Call ReadRegistry()  
  111.        Call MsgInformation("Changes made!") 
  112.     end if
  113.  
  114.  else
  115.     Call MsgError("Please select an item")
  116.  end if
  117. End Sub
  118.  
  119.  
  120.  
  121. Sub MoveFolder(CurrentFolder,NewFolder)
  122.  if right(CurrentFolder,1)<>"\" then
  123.     CurrentFolder=CurrentFolder & "\"
  124.  end if
  125.  
  126.  if right(NewFolder,1)<>"\" then
  127.     NewFolder=NewFolder & "\"
  128.  end if
  129.  
  130.  'write a value
  131.  Call RegWriteValue(CurrentFolder & "XSET Changed","yes",1)
  132.  
  133.  
  134.  'move values for base path
  135.  Call MoveValues(CurrentFolder,NewFolder)
  136.  
  137.  
  138.  'check for any existing subfolder
  139.  iC=RegEnumPaths(CurrentFolder)
  140.  if iC>0 then
  141.     Dim aryTemp()
  142.     ReDim aryTemp(iC)
  143.  
  144.     for i=1 to iC 
  145.         aryTemp(i)=RegEnumElement(i) & "\"
  146.     next
  147.  
  148.     for i=1 to iC
  149.         sP_Old=CurrentFolder & aryTemp(i)
  150.         sP_New=NewFolder & aryTemp(i)
  151.         Call MoveValues(sP_Old,sP_New)        
  152.         Call RegDeletePath(sP_Old)      
  153.     next 
  154.  end if
  155.  
  156.  
  157.  'remove old path
  158.  Call RegDeletePath(CurrentFolder) 
  159. End Sub
  160.  
  161.  
  162. Sub MoveValues(OldFolder,NewFolder)
  163.  iC=RegEnumValues(OldFolder)
  164.  for i=1 to iC
  165.      x_Name=RegEnumElement(i)
  166.      x_Type=RegValueType(OldFolder & x_Name)
  167.      x_Value=RegReadValue(OldFolder & x_Name)
  168.  
  169.      'move to new location
  170.      Call RegWriteValue(NewFolder & x_Name,x_Value,x_Type)
  171.  
  172.      'delete old value
  173.      Call RegDeleteValue(OldFolder & x_Name)
  174.  next 
  175.  
  176. End Sub
  177.  
  178.  
  179.  
  180. Sub Plugin_Terminate 
  181. End Sub
  182.